//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.ComponentModel;

namespace EntLibContrib.Resource.Configuration.Design
{
	/// <summary>
	/// Assembly Resource Name type to hold the two string components that make up an assembly resource name
	/// </summary>
	/// <remarks>An assembly resource name is the combination of an assembly name and a resource base name.</remarks>
	[TypeConverter(typeof(AssemblyResourceNameConverter))]
	public class AssemblyResourceName : ResourceName
	{
		#region Fields
		private string assemblyName;
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the name of the assembly.
		/// </summary>
		/// <value>The name of the assembly.</value>
		[ReadOnly(true)]
		[ResourceDescription("ResourceAssemblyNameDescription")]
		public string AssemblyName
		{
			get
			{
				return this.assemblyName;
			}
			set
			{
				if (!String.IsNullOrEmpty(value))
					this.assemblyName = value.Trim();
			}
		}
		#endregion
			
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="AssemblyResourceName"/> class.
		/// </summary>
		public AssemblyResourceName() : this (String.Empty, String.Empty)
		{
		}
			
		/// <summary>
		/// Initializes a new instance of the <see cref="AssemblyResourceName"/> class.
		/// </summary>
		/// <param name="assemblyName">Name of the assembly.</param>
		/// <param name="baseName">Name of the base.</param>
		public AssemblyResourceName(string assemblyName, string baseName) : base(baseName)
		{
			this.assemblyName = assemblyName;
		}
		#endregion
	}
}
